package com.smart.common.utils;

import com.alibaba.fastjson.JSON;
import com.smart.common.result.BaseResult;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * @author yangbingquan
 * @version 1.0
 * @date 2021/5/11 15:13
 */
public class ResponseUtils {
    public static void responseToJson(HttpServletResponse response, BaseResult<?> result) throws IOException {
        response.setContentType("application/json; charset=utf-8");
        response.getWriter().print(JSON.toJSONString(result));
    }
}
